# the minimum version of CMake.
cmake_minimum_required(VERSION 3.6.1)
set(CMAKE_BUILD_TYPE Release)
#set(OHOS_STL c++_static)
set(OHOS_STL none)
#set(OHOS_ARCH arm64-v8a)
set(OHOS_ARCH armeabi-v7a)

if(NOT DEFINED ANDROID)
    message("test ohos compile")
    if(DEFINED WIN32)
        message("Windows")
        set(NDK_PATH "D:/ohos/sdk/OpenHarmony/9/native")
    else()
        message("Linux")
        set(NDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../native)
    endif()
    set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/ohos.toolchain.cmake)
else()
    set(NDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../android-ndk-r20b)
    set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/android.toolchain.cmake)
endif()

project(test)

add_executable(uart_test uart_test.c)